***some of these are incorrect but some are included only in this top list and not in the bottom list
*replace cowcode= 700 if country=="Afghanistan"
replace cowcode= 339 if country=="Albania"
replace cowcode= 615 if country=="Algeria"
replace cowcode= 232 if country=="Andorra"
replace cowcode= 540 if country=="Angola"
replace cowcode= 58 if country=="Antigua and Barbuda"
replace cowcode= 58 if country=="Antigua & Barbuda"
replace cowcode= 160 if country=="Argentina"
replace cowcode= 371 if country=="Armenia"
replace cowcode= 900 if country=="Australia"
replace cowcode= 305 if country=="Austria"
replace cowcode= 373 if country=="Azerbaijan"
replace cowcode= 31 if country=="Bahamas"
replace cowcode= 31 if country=="Bahamas, The"
replace cowcode= 692 if country=="Bahrain"
replace cowcode= 771 if country=="Bangladesh"
replace cowcode= 53 if country=="Barbados"
replace cowcode= 370 if country=="Belarus"
replace cowcode= 370 if country=="Byelarus"
replace cowcode= 211 if country=="Belgium"
replace cowcode= 211 if country=="Belgium-Luxembourg"
replace cowcode= 80 if country=="Belize"
replace cowcode= 434 if country=="Benin"
replace cowcode= 760 if country=="Bhutan"
replace cowcode= 145 if country=="Bolivia"
replace cowcode= 346 if country=="Bosnia"
replace cowcode= 346 if country=="Bosnia and Herzegovina"
replace cowcode= 346 if country=="Bosnia & Herzegovina"
replace cowcode= 346 if country=="Bosnia-Hercegovenia"
replace cowcode= 571 if country=="Botswana"
replace cowcode= 140 if country=="Brazil"
replace cowcode= 835 if country=="Brunei"
replace cowcode= 835 if country=="Brunei Darussalam"
replace cowcode= 355 if country=="Bulgaria"
replace cowcode= 439 if country=="Burkina Faso"
replace cowcode= 516 if country=="Burundi"
replace cowcode= 811 if country=="Cambodia"
replace cowcode= 471 if country=="Cameroon"
replace cowcode= 20 if country=="Canada"
replace cowcode= 402 if country=="Cape Verde"
replace cowcode= 402 if country=="Cape Verde Is"
replace cowcode= 402 if country=="Cape Verde Is."
replace cowcode= 482 if country=="Cen African Rep"
replace cowcode= 482 if country=="Central African Republic"
replace cowcode= 482 if country=="Central African Rep."
replace cowcode= 482 if country=="Central African Rep"
replace cowcode= 482 if country=="C.African Rep."
replace cowcode= 483 if country=="Chad"
replace cowcode= 155 if country=="Chile"
replace cowcode= 710 if country=="China"
replace cowcode= 710 if country=="China P Rep"
replace cowcode= 710 if country=="China, P. R."
replace cowcode= 100 if country=="Colombia"
replace cowcode = 581 if country == "Comoros"
replace cowcode = 581 if country == "Comoro Is."
replace cowcode= 484 if country=="Congo"
replace cowcode= 484 if country=="Congo-Brz"
replace cowcode= 484 if country=="Congo 'Brazzaville'"
replace cowcode= 490 if country== "Congo DR"
replace cowcode= 490 if country== "DR Congo (Zaire)"
replace cowcode= 490 if country== "Congo, Dem. Rep."
replace cowcode= 490 if country== "Dem. Rep. Congo"
replace cowcode= 490 if country== "Dem. Rep."
replace cowcode= 490 if country== "Congo, Democratic Republic of"
replace cowcode= 490 if country== "Zaire (Congo Kinshasa)"
replace cowcode= 490 if country== "Congo, Democratic Republic of the"
replace cowcode= 490 if country== "Democratic Republic of the Congo"
replace cowcode= 484 if country== "Congo, Rep."
replace cowcode= 484 if country== "Congo, Republic of the"
replace cowcode= 490 if country=="Congo/Zaire"
replace cowcode= 490 if country=="Zaire/Congo Dem Rep"
replace cowcode= 490 if country=="Zaire"
replace cowcode= 94 if country=="Costa Rica"
replace cowcode= 94 if country=="Costarica"
replace cowcode= 437 if country=="Cote d'Ivoire"
replace cowcode= 437 if country=="Cote d`Ivoire"
replace cowcode= 437 if country=="C�te d'Ivoire"
replace cowcode= 437 if country=="Cote d Ivoire"
replace cowcode= 437 if country=="C�te d�Ivoire"
replace cowcode= 344 if country=="Croatia"
replace cowcode= 40 if country=="Cuba"
replace cowcode= 352 if country=="Cyprus"
replace cowcode= 352 if country=="Turk Cyprus"
replace cowcode= 316 if country=="Czech Republic"
replace cowcode= 316 if country=="Czechrep"
replace cowcode= 316 if country=="Czech Rep."
replace cowcode= 315 if country=="Czechoslovakia"
replace cowcode= 315 if country=="Czech Rep"
replace cowcode= 390 if country=="Denmark"
replace cowcode= 522 if country=="Djibouti"
replace cowcode= 54 if country=="Dominica"
replace cowcode= 42 if country=="Dominican Rep"
replace cowcode= 42 if country=="Dominican Republic"
replace cowcode= 42 if country=="Dominican Rep."
replace cowcode= 130 if country=="Ecuador"
replace cowcode= 651 if country=="Egypt"
replace cowcode= 651 if country=="Egypt, Arab Rep."
replace cowcode= 92 if country=="El Salvador"
replace cowcode= 411 if country=="Equatorial Guinea"
replace cowcode= 531 if country=="Eritrea"
replace cowcode= 366 if country=="Estonia"
replace cowcode= 530 if country=="Ethiopia"
replace cowcode= 530 if country=="Ethiopia PDR"
replace cowcode= 950 if country=="Fiji"
replace cowcode= 375 if country=="Finland"
replace cowcode= 220 if country=="France"
replace cowcode= 481 if country=="Gabon"
replace cowcode= 420 if country=="Gambia"
replace cowcode= 420 if country=="Gambia, The"
replace cowcode= 420 if country=="Gambia The"
replace cowcode= 372 if country=="Georgia"
replace cowcode= 255 if country=="Germany"
replace cowcode= 265 if country=="Germany East"
replace cowcode= 265 if country=="East Germany"
replace cowcode= 265 if country=="GDR"
replace cowcode= 265 if country=="East Germany (GDR)"
replace cowcode= 265 if country=="German Dem. Rep."
replace cowcode= 265 if country=="Germany Dem Rep"
replace cowcode= 260 if country=="Germany West"
replace cowcode= 260 if country=="West Germany"
replace cowcode= 260 if country=="Germanyfed. Rep."
replace cowcode= 260 if country=="Germany (FRG)"
replace cowcode= 260 if country=="Germany Fed Rep"
replace cowcode= 452 if country=="Ghana"
replace cowcode= 350 if country=="Greece"
replace cowcode= 55 if country=="Grenada"
replace cowcode= 55 if country=="Greneda"
replace cowcode= 90 if country=="Guatemala"
replace cowcode= 438 if country=="Guinea"
replace cowcode= 438 if country=="Guinea  "
replace cowcode= 404 if country=="Guinea Bissau"
replace cowcode= 404 if country=="Guinea-Bissau"
replace cowcode= 404 if country=="Guinea-Bisau"
replace cowcode= 110 if country=="Guyana"
replace cowcode= 41 if country=="Haiti"
replace cowcode= 91 if country=="Honduras"
replace cowcode= 310 if country=="Hungary"
replace cowcode= 395 if country=="Iceland"
replace cowcode= 750 if country=="India"
replace cowcode= 850 if country=="Indonesia"
replace cowcode= 850 if country=="Indonesia (including Timor until 1999)"
replace cowcode= 630 if country=="Iran"
replace cowcode= 630 if country=="Iran, Islamic Republic of"
replace cowcode= 630 if country=="Iran (Islamic Republic of)"
replace cowcode= 630 if country=="Iran, Islamic Rep."
replace cowcode= 630 if country=="Iran Islam Rep"
replace cowcode= 645 if country=="Iraq"
replace cowcode= 205 if country=="Ireland"
replace cowcode= 666 if country=="Israel"
replace cowcode= 325 if country=="Italy"
replace cowcode= 437 if country=="Ivory Coast"
replace cowcode= 51 if country=="Jamaica"
replace cowcode= 740 if country=="Japan"
replace cowcode= 663 if country=="Jordan"
replace cowcode= 705 if country=="Kazakstan"
replace cowcode= 705 if country=="Kazakhstan"
replace cowcode= 501 if country=="Kenya"
replace cowcode= 501 if country=="Kenya (1)"
replace cowcode= 946 if country=="Kiribati"
replace cowcode= 731 if country=="Korea North"
replace cowcode= 731 if country=="Korea, North"
replace cowcode= 731 if country=="N. Korea"
replace cowcode= 731 if country=="North Korea"
replace cowcode= 731 if country=="Korea DPR"
replace cowcode= 731 if country=="Korea, Democratic People's Republic of"
replace cowcode= 731 if country=="Korea, Democratic People's Repu"
replace cowcode= 731 if country=="Korea Dem P Rep"
replace cowcode= 731 if country=="Democratic People's Republic of Korea"
replace cowcode= 731 if country=="Korea, Dem. Rep."
replace cowcode= 732 if country=="Korea South"
replace cowcode= 732 if country=="Korea, South"
replace cowcode= 732 if country=="Korea, S."
replace cowcode= 732 if country=="South Korea"
replace cowcode= 732 if country=="Korea Rep"
replace cowcode= 732 if country=="Korea, Rep."
replace cowcode= 732 if country=="Korea, Republic of"
replace cowcode= 732 if country=="Republic of Korea"
replace cowcode= 690 if country=="Kuwait"
replace cowcode= 703 if country=="Kyrgyz Republic"
replace cowcode= 703 if country=="Kyrgyzstan"
replace cowcode= 703 if country=="Kyrgystan"
replace cowcode= 812 if country=="Laos"
replace cowcode= 812 if country=="Lao"
replace cowcode= 812 if country=="Lao PDR"
replace cowcode= 812 if country=="Lao People's Democratic Republic"
replace cowcode= 812 if country=="Lao P Dem Rep"
replace cowcode= 367 if country=="Latvia"
replace cowcode= 660 if country=="Lebanon"
replace cowcode= 570 if country=="Lesotho"
replace cowcode= 450 if country=="Liberia"
replace cowcode= 620 if country=="Libya"
replace cowcode= 620 if country=="Libyan Arab Jamahiriya"
replace cowcode= 620 if country=="Libyan Arab Jamah"
replace cowcode= 223 if country=="Liechtenstein"
replace cowcode= 368 if country=="Lithuania"
replace cowcode= 212 if country=="Luxembourg"
replace cowcode= 212 if country=="Luxemburg"
replace cowcode= 343 if country=="Macedonia"
replace cowcode= 343 if country=="Macedonia, FYR"
replace cowcode= 343 if country=="Macedonia FRY"
replace cowcode= 343 if country=="The former Yugoslav Republic of Macedonia"
replace cowcode= 580 if country=="Madagascar"
replace cowcode= 553 if country=="Malawi"
replace cowcode= 820 if country=="Malaysia"
replace cowcode= 781 if country=="Maldives"
replace cowcode= 432 if country=="Mali"
replace cowcode= 338 if country=="Malta"
replace cowcode= 983 if country=="Marshall Islands"
replace cowcode= 983 if country=="Marshall Is"
replace cowcode= 435 if country=="Mauritania"
replace cowcode= 590 if country=="Mauritius"
replace cowcode= 70 if country=="Mexico"
replace cowcode= 987 if country=="Micronesia"
replace cowcode= 987 if country=="Micronesia Fed States"
replace cowcode= 987 if country=="Micronesia, Fed. States"
replace cowcode= 987 if country=="Federated States of Micronesia"
replace cowcode= 987 if country=="Micronesia, Fed. Sts."
replace cowcode= 359 if country=="Moldova"
replace cowcode= 359 if country=="Moldova Rep"
replace cowcode= 359 if country=="Republic of Moldova"
replace cowcode= 221 if country=="Monaco"
replace cowcode= 712 if country=="Mongolia"
*replace cowcode= 341 if country=="Montenegro"
replace cowcode= 600 if country=="Morocco"
replace cowcode= 541 if country=="Mozambique"
replace cowcode= 775 if country=="Burma"
replace cowcode= 775 if country=="Myanmar"
replace cowcode= 565 if country=="Namibia"
replace cowcode= 970 if country=="Nauru"
replace cowcode= 790 if country=="Nepal"
replace cowcode= 210 if country=="Netherlands"
replace cowcode= 210 if country=="Nertherlands"
replace cowcode= 920 if country=="New Zealand"
replace cowcode= 920 if country=="New Zeland"
replace cowcode= 93 if country=="Nicaragua"
replace cowcode= 436 if country=="Niger"
replace cowcode= 475 if country=="Nigeria"
replace cowcode= 385 if country=="Norway"
replace cowcode= 698 if country=="Oman"
replace cowcode= 770 if country=="Pakistan"
replace cowcode= 986 if country=="Palau"
replace cowcode= 95 if country=="Panama"
replace cowcode= 910 if country=="Papua New Guinea"
replace cowcode= 910 if country=="Papua N.G."
replace cowcode= 150 if country=="Paraguay"
replace cowcode= 135 if country=="Peru"
replace cowcode= 840 if country=="Philippines"
replace cowcode= 290 if country=="Poland"
replace cowcode= 290 if country=="Polan"
replace cowcode= 235 if country=="Portugal"
replace cowcode= 694 if country=="Qatar"
replace cowcode= 360 if country=="Romania"
replace cowcode= 365 if country=="Russia"
replace cowcode= 365 if country=="Russian Federation"
replace cowcode= 517 if country=="Rwanda"
replace cowcode= 990 if country=="Samoa"
replace cowcode= 990 if country=="Western Samoa"
replace cowcode= 331 if country=="San Marino"
replace cowcode= 403 if country=="Sao Tome and Principe"
replace cowcode= 403 if country=="Sao Tome & Principe"
replace cowcode= 670 if country=="Saudi Arabia"
replace cowcode= 433 if country=="Senegal"
replace cowcode= 345 if country=="Serbia" 
replace cowcode= 345 if country=="Serbia & Montenegro" 
replace cowcode= 345 if country=="Serbia & Mont."  
replace cowcode= 345 if country=="Serbia and Montenegro"  
replace cowcode= 345 if country=="Serbia Montenegro"  
*replace cowcode= 345 if country=="Serbia/Montenegro/Kosovo"  /*maddison fixed in cleanMad.do*/
replace cowcode= 591 if country=="Seychelles"
replace cowcode= 591 if country=="Seychelle"
replace cowcode= 451 if country=="Sierra Leone"
replace cowcode= 830 if country=="Singapore"
replace cowcode= 317 if country=="Slovakia"
replace cowcode= 317 if country=="Slovak Republic"
replace cowcode= 317 if country=="Slovak Rep."
replace cowcode= 349 if country=="Slovenia"
replace cowcode= 520 if country=="Somalia"
replace cowcode= 940 if country=="Solomon Islands"
replace cowcode= 940 if country=="Solomon Is"
replace cowcode= 560 if country=="South Africa"
replace cowcode= 817 if country=="South Vietnam"
replace cowcode= 680 if country=="South Yemen"
replace cowcode= 680 if country=="Yemen, South"
replace cowcode= 365 if country=="Soviet Union"
replace cowcode= 230 if country=="Spain"
replace cowcode= 780 if country=="Sri Lanka"
replace cowcode= 60 if country=="St Kitts and Nevis"
replace cowcode= 60 if country=="Saint Kitts & Nevis"
replace cowcode= 60 if country=="St. Kitts and Nevis"
replace cowcode= 60 if country=="Saint Kitts and Nevis"
replace cowcode= 56 if country=="St Lucia"
replace cowcode= 56 if country=="St. Lucia"
replace cowcode= 56 if country=="Saint Lucia"
replace cowcode= 57 if country=="St Vincent and the Grenadines"
replace cowcode= 57 if country=="Saint Vincent and Grenadines"
replace cowcode= 57 if country=="Saint Vincent and the Grenadines"
replace cowcode= 57 if country=="St Vincent & the Grenadines"
replace cowcode= 57 if country=="St Vincent and The Grenadines"
replace cowcode= 57 if country=="St. Vincent & the Grenadines"
replace cowcode= 57 if country=="St. Vincent and the Grenadines"
replace cowcode= 625 if country=="Sudan"
replace cowcode= 115 if country=="Suriname"
replace cowcode= 572 if country=="Swaziland"
replace cowcode= 380 if country=="Sweden"
replace cowcode= 380 if country=="Sweeden"
replace cowcode= 225 if country=="Switzerland"
replace cowcode= 652 if country=="Syria"
replace cowcode= 652 if country=="Syrian Arab Republic"
replace cowcode= 652 if country=="Syrian Arab Rep"
replace cowcode= 713 if country=="Taiwan"
replace cowcode= 713 if country=="Taiwan (China)"
replace cowcode= 713 if country=="Taiwan, Province of China"
replace cowcode= 702 if country=="Tajikistan"
replace cowcode= 510 if country=="Tanzania"
replace cowcode= 510 if country=="Tanzania, United Republic of"
replace cowcode= 510 if country=="Tanzania Uni Rep"
replace cowcode= 510 if country=="United Republic of Tanzania"
replace cowcode= 800 if country=="Thailand"
replace cowcode= 711 if country=="Tibet"
replace cowcode= 860 if country=="Timor-Leste"
replace cowcode= 860 if country=="Timor Leste"
replace cowcode= 860 if country=="East Timor (included in Indonesia until 1999)"  
replace cowcode= 461 if country=="Togo"
replace cowcode= 955 if country=="Tonga"
replace cowcode= 52 if country=="Trinidad and Tobago"
replace cowcode= 52 if country=="Trinidad & Tobago"
replace cowcode= 52 if country=="Tirinidad and Tobago"
replace cowcode= 616 if country=="Tunisia"
replace cowcode= 640 if country=="Turkey"
replace cowcode= 701 if country=="Turkmenistan"
replace cowcode= 947 if country=="Tuvalu"
replace cowcode= 696 if country=="UAE"
replace cowcode= 696 if country=="United Arab Emirates"
replace cowcode= 696 if country=="U. Arab Emirates"
replace cowcode= 500 if country=="Uganda"
replace cowcode= 369 if country=="Ukraine"
replace cowcode= 200 if country=="United Kingdom"
replace cowcode= 200 if country=="United Kingdom of Great Britain & Northern Ireland"
replace cowcode= 200 if country=="Uk"
replace cowcode= 200 if country=="UK"
replace cowcode= 200 if country=="United  Kingdom"
replace cowcode= 2 if country=="Usa"
replace cowcode= 2 if country=="USA"
replace cowcode= 2 if country=="United States"
replace cowcode= 2 if country=="United States of America"
replace cowcode= 165 if country=="Uruguay"
replace cowcode= 365 if country=="USSR"
replace cowcode= 704 if country=="Uzbekistan"
replace cowcode= 935 if country=="Vanuatu"
replace cowcode= 101 if country=="Venezuela"
replace cowcode= 101 if country=="Venezuela, Bolivarian Republic of"
replace cowcode= 101 if country=="Venezuela, RB"
replace cowcode= 816 if country=="Vietnam"
replace cowcode= 816 if country=="Viet Nam"
replace cowcode= 680 if country=="Yemen (PDR)"
replace cowcode= 680 if country=="Yemen, (PDR)"
replace cowcode= 680 if country=="Yemen Peop. Rep."
replace cowcode= 680 if country=="Yemen P Dem Rep"
replace cowcode= 680 if country=="South Yemen"
replace cowcode= 678 if country=="Yemen (AR)"
replace cowcode= 678 if country=="Yemen, (AR)"
replace cowcode= 678 if country=="Yemen Arab Rep."
replace cowcode= 678 if country=="Yemen Arab Rep"
replace cowcode= 678 if country=="Yemen, Republic of"
replace cowcode= 678 if country=="Yemen, Rep."
replace cowcode= 678 if country=="Yemen"
replace cowcode= 678 if country=="Yemen, North"
replace cowcode= 345 if country=="Yugoslavia"
replace cowcode= 345 if country=="Yugoslavia (former)"
replace cowcode= 345 if country=="Yugoslavia, FR"
replace cowcode= 551 if country=="Zambia"
replace cowcode= 511 if country=="Zanzibar"
replace cowcode= 552 if country=="Zimbabwe"
 


***These below are all correct***
replace cowcode= 700 if country=="Afghanistan"
replace cowcode= 339 if country=="Albania"
replace cowcode= 615 if country=="Algeria"
replace cowcode= 232 if country=="Andorra"
replace cowcode= 540 if country=="Angola"
replace cowcode= 58 if country=="Antigua and Barbuda"
replace cowcode= 58 if country=="Antigua & Barbuda"
replace cowcode= 160 if country=="Argentina"
replace cowcode= 371 if country=="Armenia"
replace cowcode= 900 if country=="Australia"
replace cowcode= 305 if country=="Austria"
replace cowcode= 373 if country=="Azerbaijan"
replace cowcode= 31 if country=="Bahamas"
replace cowcode= 31 if country=="Bahamas, The"
replace cowcode= 692 if country=="Bahrain"
replace cowcode= 771 if country=="Bangladesh"
replace cowcode= 53 if country=="Barbados"
replace cowcode= 370 if country=="Belarus"
replace cowcode= 211 if country=="Belgium"
replace cowcode= 211 if country=="Belgium-Luxembourg"
replace cowcode= 80 if country=="Belize"
replace cowcode= 434 if country=="Benin"
replace cowcode= 760 if country=="Bhutan"
replace cowcode= 145 if country=="Bolivia"
replace cowcode= 346 if country=="Bosnia"
replace cowcode= 346 if country=="Bosnia and Herzegovina"
replace cowcode= 346 if country=="Bosnia & Herzegovina"
replace cowcode= 346 if country=="Bosnia-Herzegovina"
replace cowcode= 571 if country=="Botswana"
replace cowcode= 140 if country=="Brazil"
replace cowcode= 835 if country=="Brunei"
replace cowcode= 835 if country=="Brunei Darussalam"
replace cowcode= 355 if country=="Bulgaria"
replace cowcode= 439 if country=="Burkina Faso"
replace cowcode= 516 if country=="Burundi"
replace cowcode= 811 if country=="Cambodia"
replace cowcode= 471 if country=="Cameroon"
replace cowcode= 20 if country=="Canada"
replace cowcode= 402 if country=="Cape Verde"
replace cowcode= 402 if country=="Cape Verde Island"
replace cowcode= 482 if country=="Cen African Rep"
replace cowcode= 482 if country=="Central African Republic"
replace cowcode= 482 if country=="Central African Rep."
replace cowcode= 483 if country=="Chad"
replace cowcode= 155 if country=="Chile"
replace cowcode= 710 if country=="China"
replace cowcode= 100 if country=="Colombia"
replace cowcode = 581 if country == "Comoros"
replace cowcode = 581 if country == "Comoro Is."
replace cowcode = 581 if country == "Comoro Island"
replace cowcode= 484 if country=="Congo"
replace cowcode= 484 if country=="Congo-Brz"
replace cowcode= 484 if country== "Congo 'Brazzaville'"
replace cowcode= 484 if country== "Congo Brazzaville"
replace cowcode= 490 if country== "Congo DR"
replace cowcode= 490 if country== "Congo, DR"
replace cowcode= 490 if country== "Congo, Dem. Rep."
replace cowcode= 490 if country== "Dem. Rep. Congo"
replace cowcode= 490 if country== "Dem. Rep."
replace cowcode= 490 if country== "Congo, Democratic Republic of"
replace cowcode= 490 if country== "Congo, the Democratic Republic of the"
replace cowcode= 490 if country== "Congo Kinshasa"
replace cowcode= 484 if country== "Congo, Rep."
replace cowcode= 490 if country=="Congo/Zaire"
replace cowcode= 490 if country=="Zaire (Congo Kinshasa)"
replace cowcode= 94 if country=="Costa Rica"
replace cowcode= 94 if country=="Costarica"
replace cowcode= 437 if country=="Cote d'Ivoire"
replace cowcode= 437 if country=="Cote d`Ivoire"
replace cowcode= 437 if country=="C�te d'Ivoire"
replace cowcode= 437 if country=="Cote d Ivoire"
replace cowcode=437 if country=="C�te d'Ivoire"
replace cowcode= 344 if country=="Croatia"
replace cowcode= 40 if country=="Cuba"
replace cowcode= 352 if country=="Cyprus"
replace cowcode= 352 if country=="Turk Cyprus"
replace cowcode= 316 if country=="Czech Republic"
replace cowcode= 316 if country=="Czechrep"
replace cowcode= 315 if country=="Czechoslovakia"
replace cowcode= 390 if country=="Denmark"
replace cowcode= 522 if country=="Djibouti"
replace cowcode= 54 if country=="Dominica"
replace cowcode= 42 if country=="Dominican Rep"
replace cowcode= 42 if country=="Dominican Republic"
replace cowcode= 42 if country=="Dominican Rep."
replace cowcode= 130 if country=="Ecuador"
replace cowcode= 651 if country=="Egypt"
replace cowcode= 651 if country=="Egypt, Arab Rep."
replace cowcode= 92 if country=="El Salvador"
replace cowcode= 411 if country=="Equatorial Guinea"
replace cowcode= 531 if country=="Eritrea"
replace cowcode= 366 if country=="Estonia"
replace cowcode= 530 if country=="Ethiopia"
replace cowcode= 530 if country=="Ethiopia PDR"
replace cowcode= 950 if country=="Fiji"
replace cowcode= 375 if country=="Finland"
replace cowcode= 220 if country=="France"
replace cowcode= 481 if country=="Gabon"
replace cowcode= 420 if country=="Gambia"
replace cowcode= 420 if country=="Gambia, The"
replace cowcode= 372 if country=="Georgia"
replace cowcode= 255 if country=="Germany"
replace cowcode= 265 if country=="Germany East"
replace cowcode= 265 if country=="GDR"
replace cowcode= 265 if country=="German Dem. Rep."
replace cowcode= 265 if country=="German DR"
replace cowcode= 260 if country=="Germany West"
replace cowcode= 260 if country=="Germanyfed. Rep."
replace cowcode= 452 if country=="Ghana"
replace cowcode= 350 if country=="Greece"
replace cowcode= 55 if country=="Grenada"
replace cowcode= 90 if country=="Guatemala"
replace cowcode= 438 if country=="Guinea"
replace cowcode= 404 if country=="Guinea Bissau"
replace cowcode= 404 if country=="Guinea-Bissau"
replace cowcode= 110 if country=="Guyana"
replace cowcode= 41 if country=="Haiti"
replace cowcode= 91 if country=="Honduras"
replace cowcode= 310 if country=="Hungary"
replace cowcode= 395 if country=="Iceland"
replace cowcode= 750 if country=="India"
replace cowcode= 850 if country=="Indonesia"
replace cowcode= 630 if country=="Iran"
replace cowcode= 630 if country=="Iran, Islamic Republic of"
replace cowcode= 630 if country=="Iran, Islamic Rep."
replace cowcode= 645 if country=="Iraq"
replace cowcode= 205 if country=="Ireland"
replace cowcode= 666 if country=="Israel"
replace cowcode= 325 if country=="Italy"
replace cowcode= 437 if country=="Ivory Coast"
replace cowcode= 51 if country=="Jamaica"
replace cowcode= 740 if country=="Japan"
replace cowcode= 663 if country=="Jordan"
replace cowcode= 705 if country=="Kazakhstan"
replace cowcode= 501 if country=="Kenya"
replace cowcode= 946 if country=="Kiribati"
replace cowcode= 731 if country=="Korea North"
replace cowcode= 731 if country=="N. Korea"
replace cowcode= 731 if country=="North Korea"
replace cowcode= 731 if country=="Korea DPR"
replace cowcode= 731 if country=="Korea, Democratic People's Republic of"
replace cowcode= 731 if country=="Korea, Dem. Rep."
replace cowcode= 732 if country=="Korea South"
replace cowcode= 732 if country=="Korea, S."
replace cowcode= 732 if country=="South Korea"
replace cowcode= 732 if country=="Korea Rep"
replace cowcode= 732 if country=="Korea, Rep."
replace cowcode= 732 if country=="Korea, Republic of"
replace cowcode= 690 if country=="Kuwait"
replace cowcode= 703 if country=="Kyrgyz Republic"
replace cowcode= 703 if country=="Kyrgyzstan"
replace cowcode= 703 if country=="Kyrgystan"
replace cowcode= 812 if country=="Laos"
replace cowcode= 812 if country=="Lao"
replace cowcode= 812 if country=="Lao PDR"
replace cowcode= 812 if country=="Lao People's Democratic Republic"
replace cowcode= 367 if country=="Latvia"
replace cowcode= 660 if country=="Lebanon"
replace cowcode= 570 if country=="Lesotho"
replace cowcode= 450 if country=="Liberia"
replace cowcode= 620 if country=="Libya"
replace cowcode= 620 if country=="Libyan Arab Jamahiriya"
replace cowcode= 223 if country=="Liechtenstein"
replace cowcode= 368 if country=="Lithuania"
replace cowcode= 212 if country=="Luxembourg"
replace cowcode= 343 if country=="Macedonia"
replace cowcode= 343 if country=="Macedonia, FYR"
replace cowcode= 343 if country=="The former Yugoslav Republic of Macedonia"
replace cowcode= 343 if country=="Macedonia, The Former Yugoslav Republic of"
replace cowcode= 343 if country=="Macedonia, the Former Yugoslav Republic of"
replace cowcode= 580 if country=="Madagascar"
replace cowcode= 553 if country=="Malawi"
replace cowcode= 820 if country=="Malaysia"
replace cowcode= 781 if country=="Maldives"
replace cowcode= 781 if country=="Maldive Islands"
replace cowcode= 432 if country=="Mali"
replace cowcode= 338 if country=="Malta"
replace cowcode= 983 if country=="Marshall Islands"
replace cowcode= 435 if country=="Mauritania"
replace cowcode= 590 if country=="Mauritius"
replace cowcode= 70 if country=="Mexico"
replace cowcode= 987 if country=="Micronesia"
replace cowcode= 987 if country=="Federated States of Micronesia"
replace cowcode= 987 if country=="Micronesia, Federated States of"
replace cowcode= 359 if country=="Moldova"
replace cowcode= 221 if country=="Monaco"
replace cowcode= 712 if country=="Mongolia"
replace cowcode= 600 if country=="Morocco"
replace cowcode= 541 if country=="Mozambique"
replace cowcode= 775 if country=="Burma"
replace cowcode= 775 if country=="Myanmar"
replace cowcode= 565 if country=="Namibia"
replace cowcode= 970 if country=="Nauru"
replace cowcode= 790 if country=="Nepal"
replace cowcode= 210 if country=="Netherlands"
replace cowcode= 920 if country=="New Zealand"
replace cowcode= 93 if country=="Nicaragua"
replace cowcode= 436 if country=="Niger"
replace cowcode= 475 if country=="Nigeria"
replace cowcode= 385 if country=="Norway"
replace cowcode= 698 if country=="Oman"
replace cowcode= 770 if country=="Pakistan"
replace cowcode= 986 if country=="Palau"
replace cowcode= 95 if country=="Panama"
replace cowcode= 910 if country=="Papua New Guinea"
replace cowcode= 910 if country=="Papua N.G."
replace cowcode= 150 if country=="Paraguay"
replace cowcode= 135 if country=="Peru"
replace cowcode= 840 if country=="Philippines"
replace cowcode= 290 if country=="Poland"
replace cowcode= 235 if country=="Portugal"
replace cowcode= 694 if country=="Qatar"
replace cowcode= 360 if country=="Romania"
replace cowcode= 365 if country=="Russia"
replace cowcode= 365 if country=="Russian Federation"
replace cowcode= 517 if country=="Rwanda"
replace cowcode= 990 if country=="Samoa"
replace cowcode= 331 if country=="San Marino"
replace cowcode= 403 if country=="Sao Tome and Principe"
replace cowcode= 403 if country=="Sao Tome & Principe"
replace cowcode= 670 if country=="Saudi Arabia"
replace cowcode= 433 if country=="Senegal"
replace cowcode= 345 if country=="Serbia"  
replace cowcode= 345 if country=="Serbia & Montenegro"  
replace cowcode= 345 if country=="Serbia and Montenegro"  
replace cowcode= 591 if country=="Seychelles"
replace cowcode= 451 if country=="Sierra Leone"
replace cowcode= 830 if country=="Singapore"
replace cowcode= 317 if country=="Slovakia"
replace cowcode= 317 if country=="Slovak Republic"
replace cowcode= 349 if country=="Slovenia"
replace cowcode= 520 if country=="Somalia"
replace cowcode= 520 if country=="Somaliland"
replace cowcode= 940 if country=="Solomon Islands"
replace cowcode= 560 if country=="South Africa"
replace cowcode= 817 if country=="South Vietnam"
replace cowcode= 817 if country=="Vietnam South"
replace cowcode= 680 if country=="South Yemen"
replace cowcode= 365 if country=="Soviet Union"
replace cowcode= 230 if country=="Spain"
replace cowcode= 780 if country=="Sri Lanka"
replace cowcode= 60 if country=="St Kitts and Nevis"
replace cowcode= 60 if country=="Saint Kitts & Nevis"
replace cowcode= 60 if country=="St. Kitts-Nevis"
replace cowcode= 60 if country=="Saint Kitts and Nevis"
replace cowcode= 56 if country=="St Lucia"
replace cowcode= 56 if country=="Saint Lucia"
replace cowcode= 57 if country=="St Vincent and the Grenadines"
replace cowcode= 57 if country=="St.Vincent & Grenadines"
replace cowcode= 57 if country=="Saint Vincent and Grenadines"
replace cowcode= 57 if country=="St Vincent & the Grenadines"
replace cowcode= 625 if country=="Sudan"
replace cowcode= 115 if country=="Suriname"
replace cowcode= 572 if country=="Swaziland"
replace cowcode= 380 if country=="Sweden"
replace cowcode= 225 if country=="Switzerland"
replace cowcode= 652 if country=="Syria"
replace cowcode= 652 if country=="Syrian Arab Republic"
replace cowcode= 713 if country=="Taiwan"
replace cowcode= 702 if country=="Tajikistan"
replace cowcode= 510 if country=="Tanzania"
replace cowcode= 510 if country=="Tanzania, United Republic of"
replace cowcode= 800 if country=="Thailand"
replace cowcode= 711 if country=="Tibet"
replace cowcode= 860 if country=="Timor-Leste"
replace cowcode= 860 if country=="Timor Leste"
replace cowcode= 461 if country=="Togo"
replace cowcode= 955 if country=="Tonga"
replace cowcode= 52 if country=="Trinidad and Tobago"
replace cowcode= 52 if country=="Trinidad & Tobago"
replace cowcode= 616 if country=="Tunisia"
replace cowcode= 640 if country=="Turkey"
replace cowcode= 701 if country=="Turkmenistan"
replace cowcode= 947 if country=="Tuvalu"
replace cowcode= 696 if country=="UAE"
replace cowcode= 696 if country=="United Arab Emirates"
replace cowcode= 696 if country=="U. Arab Emirates"
replace cowcode= 500 if country=="Uganda"
replace cowcode= 369 if country=="Ukraine"
replace cowcode= 200 if country=="United Kingdom"
replace cowcode= 200 if country=="Uk"
replace cowcode= 200 if country=="United  Kingdom"
replace cowcode= 2 if country=="Usa"
replace cowcode= 2 if country=="USA"
replace cowcode= 2 if country=="United States"
replace cowcode= 2 if country=="United States of America"
replace cowcode= 165 if country=="Uruguay"
replace cowcode= 365 if country=="USSR"
replace cowcode= 704 if country=="Uzbekistan"
replace cowcode= 935 if country=="Vanuatu"
replace cowcode= 101 if country=="Venezuela"
replace cowcode= 101 if country=="Venezuela, Bolivarian Republic of"
replace cowcode= 101 if country=="Venezuela, RB"
replace cowcode= 816 if country=="Vietnam"
replace cowcode= 816 if country=="Vietnam North"
replace cowcode= 816 if country=="Viet Nam"
replace cowcode= 680 if country=="Yemen (PDR)"
replace cowcode= 680 if country=="Yemen, (PDR)"
replace cowcode= 680 if country=="Yemen Peop. Rep."
replace cowcode= 680 if country=="South Yemen"
replace cowcode= 680 if country=="Yemen South"
replace cowcode= 678 if country=="Yemen (AR)"
replace cowcode= 678 if country=="Yemen, (AR)"
replace cowcode= 678 if country=="Yemen Arab Rep."
replace cowcode= 678 if country=="Yemen, Republic of"
replace cowcode= 678 if country=="Yemen, Rep."
replace cowcode= 678 if country=="Yemen North"
replace cowcode= 678 if country=="Yemen"
replace cowcode= 345 if country=="Yugoslavia"
replace cowcode= 345 if country=="Yugoslavia, FR"
replace cowcode= 551 if country=="Zambia"
replace cowcode= 511 if country=="Zanzibar"
replace cowcode= 552 if country=="Zimbabwe"

*for CSP coups
replace cowcode= 775 if country=="Burma (Myanmar)"
replace cowcode= 490 if country=="DRCongo"
replace cowcode= 490 if country=="D. R. Congo"
replace cowcode= 678 if country=="North Yemen"
replace cowcode= 484 if country=="Congo-Brazzaville"
replace cowcode= 482 if country=="Cent. African Rep."
replace cowcode= 696 if country=="United Arab Em."
replace cowcode= 860 if country=="East Timor"
 
*for NELDA

replace cowcode= 260 if country=="German Federal Republic"
replace cowcode= 265 if country=="East Germany"
replace cowcode= 343 if country=="Macedonia (FYROM)"
replace cowcode= 345 if country=="Serbia (Yugoslavia)"
replace cowcode= 437 if country=="Cote d�Ivoire"
replace cowcode= 490 if country== "Democratic Republic of Congo"
replace cowcode= 775 if country=="Myanmar (Burma)"
replace cowcode= 816 if country=="Democratic Republic of Vietnam"
replace cowcode= 817 if country=="Republic of Vietnam"
replace cowcode= 860 if country=="East Timor"



 *Banks 2011*
 replace cowcode =816 if country=="Vietnam, North"
replace cowcode =530 if country=="Ethiopia(1993-)"
replace cowcode =265 if country=="Germany, East"
replace cowcode =260 if country=="Germany, West"
replace cowcode =347 if country=="Kosovo"
replace cowcode =341 if country=="Montenegro"
replace cowcode =770 if country=="Pakistan(1972-)"
replace cowcode =770 if country=="Pakistan(1947-1971)"
replace cowcode =817 if country=="Vietnam, South"
replace cowcode =626 if country=="South Sudan"
replace cowcode =52 if country=="Trinidad"
replace cowcode =365 if country=="USSR(Soviet Union)"
replace cowcode =345 if country=="Yugoslavia, Former"
replace cowcode =490 if country=="Congo-Kinshasa"















